package task_02;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/13 10:34
 * @description:
 */
public class PrinterFactory {

  public Printer getprinter(int a){
    Printer printer=null;
    if(a==0){
      printer=new HPrinter();
    }else if(a==1){
      printer = new CPrinter();

    }else {
      System.out.println("输入有误");
    }
    return printer;
  }

}
